//
//  PopupViewController.swift
//  MyOfO
//
//  Created by Yuri on 2018/3/30.
//  Copyright © 2018年 Yuri. All rights reserved.
//

import UIKit
import MIBlurPopup

//弹出框

class PopupViewController: UIViewController {
    @IBAction func gestureTap(_ sender: UITapGestureRecognizer) {
        dismiss(animated: true, completion: nil)
    }
    @IBOutlet weak var popupContainerVIew: UIView!
    @IBOutlet weak var mainView: UIView!
    
    @IBOutlet weak var closeBtn: UIButton! {
        didSet {
            closeBtn.layer.cornerRadius = 10
        }
    }
    @IBAction func closeBtnTap(_ sender: Any) {
        dismiss(animated: true, completion: nil)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

extension PopupViewController : MIBlurPopupDelegate {
    var popupView: UIView {
        return popupContainerVIew ?? UIView()
    }
    
    var blurEffectStyle: UIBlurEffectStyle {
        return UIBlurEffectStyle.light
    }
    
    var initialScaleAmmount: CGFloat {
        return 0.7
    }
    
    var animationDuration: TimeInterval {
        return 0.5
    }
    
}
